Dreamweaver Article

Using the Tab Bar Flash Element

The Tab Bar Flash Element lets you quickly add tab-based navigation to a web site. Each tab links to a location you specify. You can have as many tabs as you want, format the labels the way you like, and add icons to each.

Use the Tab Bar Flash Element to perform the following tasks:

Adding the Tab Bar to your document

To add the Tab Bar to a document, you install the Tab Bar Flash Element extension and then insert the Flash Element into an HTML document.

To add the Tab Bar to a document:

  1. Make sure Dreamweaver is not running.
  2. Install the Tab Bar Flash Element into the Dreamweaver MX 2004 menus by double-clicking the TabBar.mxp file. This will launch the Extension Manager and install the extension.
  3. Start Dreamweaver and create a new HTML document.
  4. Save the new HTML document in a location of your choice.
  5. Select Insert > Media > Tab Bar, or select Flash Elements from the Insert Bar pop-up menu and click the Tab Bar icon.
  6. You will be prompted to save the SWF file for the Tab Bar. A good place to save it is in the same folder as the HTML document you created.

Setting up the tabs

Use the Tag Inspector to enter the names and URLs for your tabs.

To set up the tabs:

  1. Select the Tab Bar to show its attributes in the Tag Inspector. In Design view, it appears as a gray box with the Flash logo in it. In Code view, it is shown as an <object> tag.
  2. In the Tag Inspector (Window > Tag Inspector), click in the right-hand column of the tabLabels field and then click the edit icon on the right-hand side.
  3. Click on the edit field and enter the name of your first tab.
  4. Click the plus (+) button to add additional tabs. Your tabs will be shown from left to right, in the order specified here. Click OK once you've entered the names of all the tabs.
  5. Next, click in the right-hand column of the URLs field in the Tag Inspector, and then click the edit icon on the right-hand side.
  6. Enter the URLs that correspond to each of the labels you entered in the previous step.
  7. You can preview your tab bar by switching to Design view, selecting the Flash Element, and clicking the Play button in the Property inspector (Window > Properties). If the tabs you created do not fit, or aren't the size you would like them to be, click Stop and then use the resize handles to change the size.

Customizing the appearance of the Tab Bar

You can alter the appearance of the Tab Bar by changing other properties in the Tag Inspector (Window > Tag Inspector). Most of these apply to the type-face used for the tab labels.

  • _fontFamily specifies the font used in the labels of the tabs. It will only show in the specified font if the person viewing the web page has it installed on their machine.
  • _fontSize specifies the size of the font used in the labels of the tabs.
  • _fontStyle switches the tab labels between italic and normal.
  • _fontWeight switches the tab labels between bold and normal.
  • _labelColor specifies the color of the tab labels.
  • _labelPlacement specifies which side of the tab the labels should be placed on, relative to the icons. If no icons are specified, this has no effect.
  • _themeColor specifies the color of the border of the tabs when the mouse cursor passes over them.
  • selectedTab specifies the tab that should be selected by default when the Tab Bar is shown. The left-most tab is number 1.

Adding icons to the tabs

You can optionally show an image next to the labels on the tabs in the Tab Bar.

To add icons to your Tab Bar:

  1. First you'll need to prepare an image file for each icon. These can be SWF files or non-progressive JPEG files sized to fit next to the tab label.
  2. Copy the image files to the same directory as the Tab Bar SWF file that you saved when adding it to your document.
  3. Select the Tab Bar in the Document window.
  4. In the Tag Inspector (Window > Tag Inspector) click in the right-hand column of the icons field and then click the edit icon on the right-hand side.
  5. Use the dialog that appears to enter the names of your icon files. If your icon files are not in the same directory as the Tab Bar SWF, include the relative or absolute paths to the icon images, much like you would for an <img> tag.
  6. Test your icons by switching to Design view, selecting the Tab Bar, and clicking the Play button in the Properties inspector.
  7. If you'd like to change the side on which the icons appear, select a different option for the _labelPlacement property in the Tag Inspector.

Using the Tab Bar in a frameset

The Tab Bar can send its URLs to another frame in a frameset. For example, you can make a horizontal frameset with the Tab Bar in the top frame, providing a sort of toolbar for your site.

To use the Tab Bar in a frameset:

  1. Follow the steps above in the Adding the Tab Bar to your document section.
  2. Follow the steps above in the Setting up the tabs section.
  3. Create a new frameset document using the Fixed Top layout, and save it to the same directory as the HTML document that contains the Tab Bar element. For more information, see Dreamweaver Help.
  4. In code view, click in the first <frame> tag, and change the src property to the name of the HTML document that contains the Tab Bar element. Or in design view, make sure the Frames panel is open. Select the first < frame> tag and change the src property to the name of the HTML document that contains the Tab Bar element.
  5. In code view, change the src of the second <frame> to the same URL as the first tab in your Tab Bar element, and set its name property to mainFrame. Or in design view, select the second <frame> and change the src property to to the same URL as the first tab in your Tab Bar element, and set its name property to mainFrame.
  6. Switch to the document with the Tab Bar in it and select the Tab Bar.
  7. In the Tag Inspector, edit the targetFrame property to read mainFrame.
  8. Open the frameset document in a browser. It should show the Tab Bar in the top frame, with the first tab selected. Clicking other tabs should open the corresponding URLs in the lower frame.